package com.googlecode.tabletags.views;

import java.util.Arrays;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.views.TagLibrary;

import com.googlecode.tabletags.views.freemarker.tags.TableTagsModels;
import com.googlecode.tabletags.views.velocity.components.ColumnDirective;
import com.googlecode.tabletags.views.velocity.components.PagerDirective;
import com.googlecode.tabletags.views.velocity.components.SortableHeaderDirective;
import com.googlecode.tabletags.views.velocity.components.TableDirective;
import com.opensymphony.xwork2.util.ValueStack;

public class TableTagsTagLibrary implements TagLibrary {

    public Object getFreemarkerModels(ValueStack stack,
        HttpServletRequest req, HttpServletResponse res) {
        return new TableTagsModels(stack, req, res);
    }

    public List<Class> getVelocityDirectiveClasses() {
        Class[] directives = new Class[] {
            ColumnDirective.class,
            PagerDirective.class,
            SortableHeaderDirective.class,
            TableDirective.class
        };
        return Arrays.asList(directives);
    }

}
